using System.CodeDom.Compiler;
using System.IO;
using Microsoft.CSharp;

namespace WebServiceClientGenerator
{
    /// <summary>
    /// Common interface use to write the source code to a given 
    /// <see cref="TextWriter"/>.
    /// </summary>
    public interface ICodeWriter
    {
        /// <summary>
        /// Gets and sets the <see cref="CodeDomProvider"/>.
        /// Default is <see cref="CSharpCodeProvider"/>.
        /// </summary>
        CodeDomProvider CodeDomProvider { get; set; }

        /// <summary>
        /// Gets and sets the <see cref="CodeGeneratorOptions"/>.
        /// </summary>
        CodeGeneratorOptions CodeGeneratorOptions { get; set; }

        /// <summary>
        /// Generate the source and write it to the <paramref name="writer"/>.
        /// </summary>
        /// <param name="writer">To where the source code is written.</param>
        void Generate(TextWriter writer);
    }
}